<template>
  <div class="goods-params" v-if="Object.keys(goodsParam).length !== 0">
    <table
      v-for="(table, indexT) in goodsParam.sizes"
      class="params-size"
      :key="indexT"
    >
      <tr v-for="(tr, indexR) in table" :key="indexR">
        <td v-for="(td, indexD) in tr" :key="indexD">{{ td }}</td>
      </tr>
    </table>
    <table class="info-param">
      <tr v-for="(info, index) in goodsParam.infos">
        <td class="info-param-key">{{ info.key }}</td>
        <td class="param-value">{{ info.value }}</td>
      </tr>
    </table>
  </div>
</template>
<script>
export default {
  name: "DetailGoodsParams",
  props: {
    goodsParam: {
      type: Object,
      default() {
        return {};
      },
    },
  },
  data() {
    return {};
  },
  methods: {},
  components: {},
};
</script>
<style scoped>
.goods-params {
  padding: 20px 15px;
  font-size: 14px;
  border-bottom: 5px solid #f2f5f8;
}
.goods-params table {
  width: 100%;
  border-collapse: collapse;
}
.goods-params table tr {
  height: 32px;
}
.goods-params td {
  border-bottom: 1px solid rgba(100, 100, 100, 0.1);
}

.info-param-key {
  /*当value的数据量比较大的时候, 会挤到key,所以给一个固定的宽度*/
  width: 95px;
}

.info-param {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.param-value {
  color: #eb4868;
}

.info-img img {
  width: 100%;
}
</style>